home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / INTGRPH.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  719 b   |  27 lines

  1. #include <graphics.h>
  2.  
  3. main()
  4. {
  5.   int errorcode;
  6.   int graphdriver = DETECT;
  7.   int graphmode;
  8.  
  9. /* Detect and initialize graphics system */
  10.   initgraph(&graphdriver, &graphmode, "c:\\turboc");
  11.   errorcode = graphresult();
  12.   if (errorcode != grOk)
  13.   {
  14.    printf("Graphics error: %s\n",
  15.    grapherrormsg(errorcode));
  16.    exit(1);
  17.   };
  18.  
  19.   settextjustify(CENTER_TEXT, CENTER_TEXT);
  20.   settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 1);
  21.   outtextxy( getmaxx() / 2, getmaxy() /2,
  22.   "Graphics programs must start with initgraph()");
  23.   outtextxy(getmaxx()/2, getmaxy() - 50,
  24.          "Press any key to exit:");
  25.   getch();       /* Wait until a key is pressed */
  26.   closegraph();        /* Exit graphics library */
  27.  }